<template>
  <div>
    <el-container>
      <el-aside width="200px">
        <template v-if="power==0">
          <admins></admins>
        </template>
        <template v-else-if="power==1">
          <asideCom></asideCom>
        </template>
        <template v-else-if="power==2">
          <salesPerson></salesPerson>
        </template>
      </el-aside>
      <el-container>
        <el-header>
          <h1>保险后台</h1>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
        <el-footer>Footer</el-footer>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import asideCom from "../../components/container/aside1";
import admins from "../../components/container/admins";
import salesPerson from "../../components/container/salesPerson";
export default {
  components: {
    asideCom,
    admins,
    salesPerson,
  },
  data() {
    return {
      power: 0,
      data: localStorage.state,
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      // console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      // console.log(key, keyPath);
    },
  },
  created() {
    this.power = this.data;
  },
};
</script>

<style scoped>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
}

body > .el-container {
  margin-bottom: 40px;
}
.el-container {
  height: 100vh;
}
</style>